<?php
define('SERVER_ROOT', dirname(__FILE__));
include SERVER_ROOT.'/config/define.php';
include SERVER_ROOT.'/config/dataconf.php';
include SERVER_ROOT.'/core/router.php';
include SERVER_ROOT.'/core/core.php';
date_default_timezone_set('PRC');
function all_time($str='start') {
    static $start_time;
    if($str=='start') {
        $start_time = microtime(true);
    }
    return microtime(true)-$start_time;
}
all_time();
$php_self = checkRouter(substr($_SERVER['PHP_SELF'],10));
$file = explode("/",substr($php_self,1));
if(!$file[0]) {
    $file = array('index','index');
}else if(!$file[1]) {
    $file = array($file[0],'index');
}

$c_name = 'control_'.$file[0];
if(!file_exists(SERVER_ROOT.'/control/'.$file[0].'.php')) {
    goUrl(PAGE_404);
}

$control = new $c_name();
if(!method_exists($control,$file[1])) {
    goUrl(PAGE_404);
}
$control->$file[1]();
?>